* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #000;
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 16px;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
}

.left-panel {
    width: 330px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
    align-items:stretch;
}

.block-table-container {
    height: 30%;
    overflow: auto;
    border: 1px solid #333;
}

.stock-table-container {
    height: 70%;
    overflow: auto;
    border: 1px solid #333;
    margin-top: -1px;
}

.right-panel {
    width: 80%;
    height: 100%;
    position: relative;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
}

th, td {
    padding: 4px 8px;
    border-bottom: 1px solid #333;
}

td:nth-child(2),
td:nth-child(3),
td:nth-child(4) {
    text-align: right;
}

th:nth-child(2),
th:nth-child(3),
th:nth-child(4) {
    text-align: right;
}

td:first-child,
th:first-child {
    text-align: left;
}

.chart-controls {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
}

.chart-type-switch {
    display: flex;
    gap: 0;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
}

.chart-type-switch button {
    background: #1a1a1a;
    border: 1px solid #333;
    border-right: none;
    color: #fff;
    padding: 2px 12px;
    cursor: pointer;
    font-size: 16px;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    letter-spacing: normal;
    width: auto;
}

.chart-type-switch button:last-child {
    border-right: 1px solid #333;
}

.chart-type-switch button.active {
    background: #333;
}

.chart-container {
    /* width: 100%;
    height: 100%; */
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 1px;
}

.chart {
    position: relative;
    border: 1px solid #333;
    background: #000;
    width: 600px;
    height: 300px;
}

.chart-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 8px;
    height: 24px;
    border-bottom: 1px solid #333;
    background: #000;
    z-index: 1;
}

.chart-title {
    font-size: 16px;
    font-weight: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-info {
    display: flex;
    gap: 15px;
    font-size: 16px;
}

.price-up {
    color: #ff0000;
}

.price-down {
    color: #00ff00;
}

.selected {
    background-color: #2a2a2a;
}

.volume-bar {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 20%;
    opacity: 0.3;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #333;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

.chart canvas {
    width: 100%;
    height: calc(100% - 24px);
    margin-top: 24px;
}

/* 板块叠加容器 */
.block-overlay-container {
    /* position: relative; */
    box-sizing: border-box;  
    width: 600px;
    /* width: 80%; height: 211px; */
}

/* 叠加模式下的图表容器 */
.chart-container.overlay-mode {
    overflow-y: auto;
    overflow-x: hidden;
    /* display: block; */
}

/* 叠加图表样式 */
.overlay-chart {
    background-color: #000000; /* 背景色改为纯黑 */
    border: 1px solid #333;
    border-radius: 4px;
    /* position: relative; */
    width: 100%;
    height: 300px;
    /* display: flex; */
    flex-direction: column;
}

.overlay-chart canvas {
    flex: 1;
    min-height: 0;
    min-width: 0;
}

/* 自定义HTML图例容器 */
.chart-wrapper {
    display: flex;
    flex: 1;
    min-height: 0;
}

.html-legend {
    width: 130px; /* 为图例分配固定宽度 */
    padding-left: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px; /* 项目间距 */
}

.legend-color-box {
    width: 12px;
    height: 12px;
    margin-right: 8px;
    flex-shrink: 0;
}

.legend-label-name {
    color: #ffffff; /* 名称设置为白色 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 超长时显示省略号 */
}

.legend-label-change {
    margin-left: auto; /* 将涨跌幅推到最右侧 */
    padding-left: 5px;
    font-weight: bold;
}

/* 叠加图表标题样式 */
.overlay-chart-title {
    color: #fff;
    font-size: 14px;
    padding: 0 8px;
    border-bottom: 1px solid #333;
    height: 24px;
    line-height: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #000;
}

.overlay-chart-title span {
    text-align: right;
}

.overlay-chart-title .title-name {
    text-align: left;
    font-weight: bold;
}

.overlay-chart-title .title-strength,
.overlay-chart-title .title-change {
    margin-left: 15px;
}

.overlay-chart-title .title-limit {
    margin-left: 15px;
    color: #f0f0f0;
}

/* 图例样式优化 */
.overlay-chart .chartjs-legend {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 4px;
}

/* 切换按钮高亮样式 */
.chart-type-switch-btn:hover {
    opacity: 0.8;
}

.chart-type-switch-btn.active {
    color: #00FFFF !important;
} 